$(function(){
	//从地址栏中获取userAwardId
	var userAwardId = getQueryString('userAwardId');
	var awardUrl = '/o2o/frontend/getawardbyuserawardid?userAwardId=' + userAwardId;
	$.getJSON(awardUrl, function(data){
		if (data.success) {
			//
			var award = data.award;
			var userAwardMap = data.userAwardMap;
			$('#award-img').attr('src',getContextPath() + award.awardImg);
			$('#create-time').text(new Date(data.userAwardMap.createTime).Format("yyyy-MM-dd"));
			$('#award-name').text(award.awardName);
			$('#award-desc').text(award.awardDesc);
			$('#award-point').text(award.point);
			var imgListHtml = '';
			//若未去实体店兑换实体奖品,生成兑换礼品的二维码供商家扫描
			if (userAwardMap.usedStatus == 0) {
				imgListHtml += '<div><img src="/o2o/frontend/generateqrcode4award?userAwardId='
					+ userAwardId 
					+ '" width="100%"/></div>';
				$('#imgList').html(imgListHtml);
			}
			
		}
		
	});	
	
	$('#me').click(function() {
		$.openPanel('#panel-left-demo');
	});
	$.init();
});